package com.RyanRestaurant.Service.Impl;


import com.RyanRestaurant.Entity.Food;
import com.RyanRestaurant.Mapper.FoodMapper;
import com.RyanRestaurant.Service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class FoodServiceImpl implements FoodService {

    @Autowired
    private FoodMapper foodMapper;

    @Override
    public Integer totalCount(String title) {
        return foodMapper.totalCount(title);
    }

    @Override
    public List<Food> getFoods(Map<String, Object> map) {
        return foodMapper.getFoods(map);
    }

    @Override
    public Integer addFood(Food food) {
        return foodMapper.addFood(food);
    }

    @Override
    public Food getFoodById(Integer id) {
        return foodMapper.getFoodById(id);
    }

    @Override
    public Integer updateFood(Food food) {
        return foodMapper.updateFood(food);
    }

    @Override
    public Integer deleteFood(Integer id) {
        return foodMapper.deleteFood(id);
    }

    @Override
    public Integer activeFood(Integer id) {
        return foodMapper.activeFood(id);
    }

    @Override
    public Integer menuTotalCount(Map<String, Object> map) {
        return foodMapper.menuTotalCount(map);
    }

    @Override
    public List<Food> menuGetFoods(Map<String, Object> map) {
        return foodMapper.menuGetFoods(map);
    }
}
